package com.hdsx.validator.validate.processor;

import java.lang.annotation.Annotation;

import com.hdsx.validator.validate.annotation.JTS;
import com.hdsx.validator.validate.annotation.JTS2;
import com.hdsx.validator.validate.annotation.JTS3;
import com.hdsx.validator.validate.annotation.OGNL;
import com.hdsx.validator.validate.annotation.Range;
import com.hdsx.validator.validate.annotation.Regex;

public class ProcessorFactory {

	public static IProcessor createProcessor(Annotation anno){
		IProcessor processor=null;
		if(anno.annotationType().equals(OGNL.class))
		{
			processor=new OGNLProcessor(); 
		}
		else if(anno.annotationType().equals(Regex.class))
		{
			processor=new RegexProcessor(); 
		}
		else if(anno.annotationType().equals(Range.class))
		{
			processor=new RangeProcessor(); 
		}
		else if(anno.annotationType().equals(JTS.class))
		{
			processor=new GeometryProcessor(); 
		}
		else if(anno.annotationType().equals(JTS2.class))
		{
			processor=new GeometryProcessor2(); 
		}
		else if(anno.annotationType().equals(JTS3.class))
		{
			processor=new GeometryProcessor3(); 
		}
		return processor;
	}
}
